import 'package:better_player/better_player.dart';
import 'package:flutter/material.dart';

import '../common/flatPanel.dart';
import '../entry.dart';

class BetterPlayerPage extends StatefulWidget {
  @override
  _BetterPlayerPageState createState() => _BetterPlayerPageState();
}

class _BetterPlayerPageState extends State<BetterPlayerPage> {
  final videoUrl =
      'https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218114723HDu3hhxqIT.mp4';

  // BetterPlayerController _betterPlayerController;

  @override
  Widget build(BuildContext context) {
    return FlatScaffold(
      Entry.BetterPlayer,
      child: AspectRatio(
        aspectRatio: 16 / 9,
        child: BetterPlayer.network(
          videoUrl,
          betterPlayerConfiguration: BetterPlayerConfiguration(
            aspectRatio: 16 / 9,
            autoPlay: true,
          ),
        ),
      ),
    );
  }
}
